<html>
<head><meta charset="utf-8"><title>reformatting diagnostics · t-compiler/wg-nll · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/index.html">t-compiler/wg-nll</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html">reformatting diagnostics</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="135926718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135926718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135926718">(Oct 16 2018 at 20:20)</a>:</h4>
<p>I was leaning a different way</p>



<a name="135926729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135926729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135926729">(Oct 16 2018 at 20:21)</a>:</h4>
<p>I was thinking of detecting cases where combining all labels into one was problematic</p>



<a name="135926734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135926734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135926734">(Oct 16 2018 at 20:21)</a>:</h4>
<p>and trying to break things up into multi-part messages (automatically)</p>



<a name="135926740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135926740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135926740">(Oct 16 2018 at 20:21)</a>:</h4>
<p>I would also like this for cases where the labels should be read in a particular order</p>



<a name="135926743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135926743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135926743">(Oct 16 2018 at 20:21)</a>:</h4>
<p>but sometimes that order doesn't happen to be the one in which they appear in the source</p>



<a name="135926745"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135926745" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135926745">(Oct 16 2018 at 20:21)</a>:</h4>
<p>(and this can't be easily predicted)</p>



<a name="135926748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135926748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135926748">(Oct 16 2018 at 20:21)</a>:</h4>
<p>anyway..</p>



<a name="135926750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135926750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135926750">(Oct 16 2018 at 20:21)</a>:</h4>
<p>yeah I've been struggling with that</p>



<a name="135926757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135926757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135926757">(Oct 16 2018 at 20:22)</a>:</h4>
<p>our use of ellipses in diagnsotics is an attempt to compensate for that</p>



<a name="135926803"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135926803" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135926803">(Oct 16 2018 at 20:22)</a>:</h4>
<p>but it clearly is a problem at times</p>



<a name="135926807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135926807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135926807">(Oct 16 2018 at 20:22)</a>:</h4>
<p>right, I think maybe we should "fall back" to something more like the older style</p>



<a name="135926813"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135926813" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135926813">(Oct 16 2018 at 20:22)</a>:</h4>
<p>or at least I wanted to toy with it</p>



<a name="135926860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135926860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135926860">(Oct 16 2018 at 20:24)</a>:</h4>
<p>By  "older style", do you mean when there's lots of snippets stacked atop each other in the error?</p>



<a name="135926903"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135926903" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135926903">(Oct 16 2018 at 20:24)</a>:</h4>
<p>hmm just had another idea :) but we should definitely break this out into a different topic</p>



<a name="135926910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135926910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135926910">(Oct 16 2018 at 20:24)</a>:</h4>
<p>I meant something where there are many "blocks" each with their own snippet + label</p>



<a name="135927037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> memoryruins <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927037">(Oct 16 2018 at 20:27)</a>:</h4>
<p>"blocks" <span class="emoji emoji-1f914" title="thinking">:thinking:</span>  ┰ ┖</p>



<a name="135927090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> memoryruins <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927090">(Oct 16 2018 at 20:28)</a>:</h4>
<p>(that could help with the linear reading)</p>



<a name="135927143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> memoryruins <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927143">(Oct 16 2018 at 20:29)</a>:</h4>
<p>how do you imagine would look for the error message before?</p>



<a name="135927146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927146">(Oct 16 2018 at 20:29)</a>:</h4>
<p>I couldn't find a good example from the top of my head, but it's roughly something like this that I wasn't a fan of:</p>
<div class="codehilite"><pre><span></span>error[E0597]: this can&#39;t happen
  --&gt; $DIR/some_test.rs
   |
LL |  main error code
   |
= note: something happens that must live until...
   |
LL |  not really relevant
   |
= note: ...this is because something is used here...
   |
LL |  not really relevant
   |
= note: ...which must live until here or something like that.
   |
LL |  not really relevant
   |
</pre></div>



<a name="135927200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927200">(Oct 16 2018 at 20:30)</a>:</h4>
<p>I don't think NLL has any errors like that</p>



<a name="135927213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927213">(Oct 16 2018 at 20:30)</a>:</h4>
<p>I found those pretty hard to follow.</p>



<a name="135927215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927215">(Oct 16 2018 at 20:30)</a>:</h4>
<p>yes, that is the older style</p>



<a name="135927230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927230">(Oct 16 2018 at 20:30)</a>:</h4>
<p>I agree it is often less good</p>



<a name="135927238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927238">(Oct 16 2018 at 20:31)</a>:</h4>
<p>some of the new-style errors are also pretty hard to follow though :)</p>



<a name="135927257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927257">(Oct 16 2018 at 20:31)</a>:</h4>
<p>that said, it occured to me now that a "footnote" approach might be interesting</p>



<a name="135927335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927335">(Oct 16 2018 at 20:32)</a>:</h4>
<p>It's true. I think it's mostly because I ended up scanning up and down the error trying to work out what was referring to what because everything was so split apart. I prefer the new errors because everything is presented in a single snippet in source order and there's less working out what everything is.</p>



<a name="135927354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927354">(Oct 16 2018 at 20:33)</a>:</h4>
<p>I've got a better way of saying that on the tip of my tongue and it just isn't happening.</p>



<a name="135927384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927384">(Oct 16 2018 at 20:33)</a>:</h4>
<div class="codehilite"><pre><span></span>15 |     };
   |     ^^
   |     1|
   |      2
   |
   | 1:  `heap_ref` dropped here while still borrowed
   | 2: borrowed value needs to live until here
</pre></div>



<a name="135927389"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927389" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927389">(Oct 16 2018 at 20:33)</a>:</h4>
<p>maybe something like that</p>



<a name="135927430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927430">(Oct 16 2018 at 20:34)</a>:</h4>
<p>hopefully using prettier "arrows"</p>



<a name="135927434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927434">(Oct 16 2018 at 20:34)</a>:</h4>
<p>this could also address the "telling a story" problem</p>



<a name="135927436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927436">(Oct 16 2018 at 20:34)</a>:</h4>
<p>since you could read 1, 2, 3 and then see the points in the code</p>



<a name="135927446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927446">(Oct 16 2018 at 20:34)</a>:</h4>
<p>That could be useful where long diagnostic messages are causing the pointers to things to get particularly long and obscuring what is happening.</p>



<a name="135927449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927449">(Oct 16 2018 at 20:34)</a>:</h4>
<p>right</p>



<a name="135927462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927462">(Oct 16 2018 at 20:35)</a>:</h4>
<p>and/or there are overlapping things</p>



<a name="135927470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927470">(Oct 16 2018 at 20:35)</a>:</h4>
<p>I'd like to present the underlines on separate lines</p>



<a name="135927475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927475">(Oct 16 2018 at 20:35)</a>:</h4>
<p>In other situations though, I think labelling directly makes more sense.</p>



<a name="135927489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927489">(Oct 16 2018 at 20:35)</a>:</h4>
<p>e.g., </p>
<div class="codehilite"><pre><span></span>  | foo(bar)
  | -------- (1)
  |     --- (2)
  |
  | (1) blah blah blah
  | (2) blah blah blah
</pre></div>



<a name="135927500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927500">(Oct 16 2018 at 20:35)</a>:</h4>
<blockquote>
<p>In other situations though, I think labelling directly makes more sense.</p>
</blockquote>
<p>yes, my hope was that the user would just say "this label here" and the code would pick an optimal organization</p>



<a name="135927556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927556">(Oct 16 2018 at 20:36)</a>:</h4>
<p>basically falling back to footnotes if the ordering constraints can't be met and/or spans overlap or get too close</p>



<a name="135927559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927559">(Oct 16 2018 at 20:36)</a>:</h4>
<p>If you did it as a "this is getting hard to read, reformat as references" then it could even be automatic by the diagnostic builder when it detects that it would be better.</p>



<a name="135927562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927562">(Oct 16 2018 at 20:36)</a>:</h4>
<p>right</p>



<a name="135927575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927575">(Oct 16 2018 at 20:37)</a>:</h4>
<p>I didn't expet to change any of the diagnostic reporting code, except maybe to indicate where ordering is needed</p>



<a name="135927584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927584">(Oct 16 2018 at 20:37)</a>:</h4>
<div class="codehilite"><pre><span></span>15 |     };
   |     - (1)
   |      - (2)
   |
   | 1:  `heap_ref` dropped here while still borrowed
   | 2: borrowed value needs to live until here
</pre></div>



<a name="135927585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927585">(Oct 16 2018 at 20:37)</a>:</h4>
<p>Would it depend on the order that labels are applied so they are numbered correctly or by source order?</p>



<a name="135927589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927589">(Oct 16 2018 at 20:37)</a>:</h4>
<p>in that alternate style, which I kind of like now, it might look like that</p>



<a name="135927593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927593">(Oct 16 2018 at 20:37)</a>:</h4>
<blockquote>
<p>Would it depend on the order that labels are applied so they are numbered correctly or by source order?</p>
</blockquote>
<p>I would say that when you do <code>span_label</code>, you should also have <code>span_ordered_label</code></p>



<a name="135927597"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927597" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927597">(Oct 16 2018 at 20:37)</a>:</h4>
<p>all calls to <code>span_ordered_label</code> are meant to be read in that order</p>



<a name="135927648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927648">(Oct 16 2018 at 20:38)</a>:</h4>
<p>often, that 'just works' in the source</p>



<a name="135927663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927663">(Oct 16 2018 at 20:38)</a>:</h4>
<p>because earlier things come earlier</p>



<a name="135927666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927666">(Oct 16 2018 at 20:38)</a>:</h4>
<p>but around loops and method calls that's not always true</p>



<a name="135927673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927673">(Oct 16 2018 at 20:38)</a>:</h4>
<p>Overall, I really like the idea.</p>



<a name="135927682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927682">(Oct 16 2018 at 20:38)</a>:</h4>
<p><span class="user-mention" data-user-id="119031">@Esteban Küber</span> you around? =)</p>



<a name="135927692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927692">(Oct 16 2018 at 20:38)</a>:</h4>
<p>the footnotes was the missing piece for me</p>



<a name="135927696"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927696" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927696">(Oct 16 2018 at 20:38)</a>:</h4>
<p>I hadn't thought of that before</p>



<a name="135927725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927725">(Oct 16 2018 at 20:39)</a>:</h4>
<p>I guess it would still be hard to handle multple multi-line spans</p>



<a name="135927728"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927728" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927728">(Oct 16 2018 at 20:39)</a>:</h4>
<p>but those are a mess anyway</p>



<a name="135927738"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927738" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927738">(Oct 16 2018 at 20:39)</a>:</h4>
<p>I guess we can "do our best"</p>



<a name="135927754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927754">(Oct 16 2018 at 20:39)</a>:</h4>
<p>and actually even those could maybe be handled with this idea of "multiple underlines per line"</p>



<a name="135927844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927844">(Oct 16 2018 at 20:40)</a>:</h4>
<p>Could annotate two places with the same reference number?</p>



<a name="135927850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135927850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135927850">(Oct 16 2018 at 20:40)</a>:</h4>
<p>I guess for multispans</p>



<a name="135928126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135928126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135928126">(Oct 16 2018 at 20:45)</a>:</h4>
<p>I'm excited about this idea :)</p>



<a name="135928251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135928251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> memoryruins <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135928251">(Oct 16 2018 at 20:46)</a>:</h4>
<p>I'm a fan :)</p>



<a name="135928268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135928268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> memoryruins <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135928268">(Oct 16 2018 at 20:46)</a>:</h4>
<p>worth hand converting some more, will highlight a bit more how it might (or places where it might not) work</p>



<a name="135928284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135928284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> memoryruins <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135928284">(Oct 16 2018 at 20:46)</a>:</h4>
<p>heading out for now, have a good one everyone <span class="emoji emoji-1f44b" title="wave">:wave:</span></p>



<a name="135928496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135928496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135928496">(Oct 16 2018 at 20:49)</a>:</h4>
<p>wrote up a gist: <a href="https://gist.github.com/nikomatsakis/80866d4407f1cc38fba0c2da7175dcf7" target="_blank" title="https://gist.github.com/nikomatsakis/80866d4407f1cc38fba0c2da7175dcf7">https://gist.github.com/nikomatsakis/80866d4407f1cc38fba0c2da7175dcf7</a></p>



<a name="135928503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135928503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135928503">(Oct 16 2018 at 20:49)</a>:</h4>
<p>does that sound about right?</p>



<a name="135928512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135928512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135928512">(Oct 16 2018 at 20:49)</a>:</h4>
<p>I was going to open up an internals thread or a rust issue or something</p>



<a name="135929892"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135929892" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135929892">(Oct 16 2018 at 21:10)</a>:</h4>
<p>I'm intrigued if not entirely convinced, but I see that it _could_ work</p>



<a name="135929932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135929932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135929932">(Oct 16 2018 at 21:11)</a>:</h4>
<p>I would keep the current behavior around span positioning though...</p>
<div class="codehilite"><pre><span></span>15 |     };
   |     -- (2)
   |     |
   |     (1)
   (1): `heap_ref` dropped here while still borrowed
   (2): borrowed value needs to live until here
</pre></div>



<a name="135929945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135929945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135929945">(Oct 16 2018 at 21:11)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="135929983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135929983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135929983">(Oct 16 2018 at 21:11)</a>:</h4>
<p>I personally find that less clear</p>



<a name="135929993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135929993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135929993">(Oct 16 2018 at 21:12)</a>:</h4>
<p><span class="user-mention" data-user-id="119031">@Esteban Küber</span> but doesn't that run into the same problem of not being able to readily <del>distinguish</del> separate the <code>}</code> from the <code>;</code> ?</p>



<a name="135930106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930106">(Oct 16 2018 at 21:13)</a>:</h4>
<p>that's fair...<br>
Sometime back I considered having a different <code>char</code> to represent multiple overlapping spans, something like </p>
<div class="codehilite"><pre><span></span>  | foo(bar)
  | ----===- (1)
  |     |
  |     (2)
  |
  | (1) blah blah blah
  | (2) blah blah blah
</pre></div>



<a name="135930125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930125">(Oct 16 2018 at 21:13)</a>:</h4>
<p>we already do that, don't we? the problem here is that the spans are adjacent, rather than overlapping</p>



<a name="135930132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930132">(Oct 16 2018 at 21:13)</a>:</h4>
<p>Maybe the overlapping logic should be applied also to adjacent spans?</p>



<a name="135930142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930142">(Oct 16 2018 at 21:13)</a>:</h4>
<p>I discarded it because it was hard to find an ascii safe char to represent <code>^</code> and <code>-</code> overlapping</p>



<a name="135930190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930190">(Oct 16 2018 at 21:14)</a>:</h4>
<p>it also seems like there could be &gt;2 labels</p>



<a name="135930205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930205">(Oct 16 2018 at 21:14)</a>:</h4>
<p>(am I just wrong about overlapping labels? Let me go find an example....)</p>



<a name="135930234"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930234" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930234">(Oct 16 2018 at 21:15)</a>:</h4>
<p>We don't. A long time ago I took a stab at using unicode chars to try something like that <a href="https://github.com/rust-lang/rust/pull/37703" target="_blank" title="https://github.com/rust-lang/rust/pull/37703">https://github.com/rust-lang/rust/pull/37703</a></p>



<a name="135930235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930235">(Oct 16 2018 at 21:15)</a>:</h4>
<p><span class="user-mention" data-user-id="119031">@Esteban Küber</span> another option — in this <em>particular case</em> at least — would be to print the start character in some way</p>



<a name="135930246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930246">(Oct 16 2018 at 21:15)</a>:</h4>
<p>e.g. with an up-arrow ▲ or something</p>



<a name="135930249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930249">(Oct 16 2018 at 21:15)</a>:</h4>
<p>ok, not so heavy</p>



<a name="135930250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930250">(Oct 16 2018 at 21:15)</a>:</h4>
<p>this of course gets into unicode</p>



<a name="135930263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930263">(Oct 16 2018 at 21:15)</a>:</h4>
<p>using <code>┗</code> and <code>┛</code> makes it clear where every span starts and end :)</p>



<a name="135930332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930332">(Oct 16 2018 at 21:16)</a>:</h4>
<p>Yep... and as you can see in that original PR, it needs a lot of work before we have something nice</p>



<a name="135930352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930352">(Oct 16 2018 at 21:17)</a>:</h4>
<p>wait, so what is this then:</p>
<div class="codehilite"><pre><span></span>10 |         if let Some(entry) = heap_ref.peek_mut() {
   |                              ^^^^^^^^-----------
   |                              |
   |                              borrowed value does not live long enough
   |                              a temporary with access to the borrow is created here ...
</pre></div>



<a name="135930354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930354">(Oct 16 2018 at 21:17)</a>:</h4>
<blockquote>
<p>using <code>┗</code> and <code>┛</code> makes it clear where every span starts and end :)</p>
</blockquote>
<p>well, even <em>then</em> you can have two instances of the same span</p>



<a name="135930362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930362">(Oct 16 2018 at 21:17)</a>:</h4>
<p>regardless, we can get around the problem by having a starting and ending delimiter for spans<br>
something along the lines of </p>
<div class="codehilite"><pre><span></span>  | foo(bar)
  | \--/\---/ (1)
  |     |
  |     (2)
  |
  | (1) blah blah blah
  | (2) blah blah blah
</pre></div>



<a name="135930367"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930367" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930367">(Oct 16 2018 at 21:17)</a>:</h4>
<p>(i.e. that is the case I was thinking of with overlapping spans)</p>



<a name="135930428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930428">(Oct 16 2018 at 21:18)</a>:</h4>
<p><span class="user-mention" data-user-id="116083">@pnkfelix</span> that's only for when 1 primary spans overlaps 1 or more secondary spans<br>
we handle that overlap by making sure we always show the shortest</p>



<a name="135930432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930432">(Oct 16 2018 at 21:18)</a>:</h4>
<div class="codehilite"><pre><span></span>10 |         if let Some(entry) = heap_ref.peek_mut() {
   |                              ^^^^^^^^ (1)
   |                              ------------------- (2)
   |
   | (1) borrowed value does not live long enough
   | (2) a temporary with access to the borrow is created here ...
</pre></div>



<a name="135930451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930451">(Oct 16 2018 at 21:19)</a>:</h4>
<p>ah okay I forgot (slash never learned properly) about the primary/secondary distinction</p>



<a name="135930473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930473">(Oct 16 2018 at 21:19)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> the reason I am a bit doubtful is because we can have potentially lots of very small overlapping spans that can make it hard to align vertically beyond the first span underline</p>



<a name="135930513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930513">(Oct 16 2018 at 21:20)</a>:</h4>
<p>granted, this might not be a problem in practice</p>



<a name="135930551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930551">(Oct 16 2018 at 21:20)</a>:</h4>
<p>Another option is to use coloring for span differentiation...</p>



<a name="135930555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930555">(Oct 16 2018 at 21:20)</a>:</h4>
<p>I don't quite understand the concern</p>



<a name="135930582"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930582" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930582">(Oct 16 2018 at 21:21)</a>:</h4>
<p>(but I don't doubt there are painful edge cases...)</p>



<a name="135930602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930602">(Oct 16 2018 at 21:21)</a>:</h4>
<div class="codehilite"><pre><span></span>10 |         if let Some(entry) = heap_ref.peek_mut() {
   |                              ^^^^^^^^ (1)
   |                              ------------------- (2)
   |                                               - (3)
   |
   | (1) borrowed value does not live long enough
   | (2) a temporary with access to the borrow is created here ...
   | (3) where does this span point to?
</pre></div>



<a name="135930651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930651">(Oct 16 2018 at 21:22)</a>:</h4>
<p>this seems ok to me</p>



<a name="135930654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930654">(Oct 16 2018 at 21:22)</a>:</h4>
<p>I guess you mean that it's hard to visually lift your eye up a few lines</p>



<a name="135930658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930658">(Oct 16 2018 at 21:22)</a>:</h4>
<p>that's true, though it could be addressed by collapsing when possible</p>



<a name="135930667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930667">(Oct 16 2018 at 21:22)</a>:</h4>
<p>it also seems <em>plausible</em> to figure it out (e.g., in emacs :P you just press up arrow a few times)</p>



<a name="135930700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930700">(Oct 16 2018 at 21:23)</a>:</h4>
<div class="codehilite"><pre><span></span> 5:21 PM

10 |         if let Some(entry) = heap_ref.peek_mut() {
   |                              ^^^^^^^^ (1)     - (3)
   |                              ------------------- (2)
   |
   | (1) borrowed value does not live long enough
   | (2) a temporary with access to the borrow is created here ...
   | (3) where does this span point to?
</pre></div>



<a name="135930714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930714">(Oct 16 2018 at 21:23)</a>:</h4>
<p>that is what I meant by "collapsing when possible" (basically whenever non-overlapping)</p>



<a name="135930718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930718">(Oct 16 2018 at 21:23)</a>:</h4>
<p>I'm trying to keep in mind the minimum common case + the worst possible case for our diagnostics ^_^</p>



<a name="135930726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930726">(Oct 16 2018 at 21:23)</a>:</h4>
<p>Overlapping that way is definitely something we'd want to do</p>



<a name="135930732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930732">(Oct 16 2018 at 21:23)</a>:</h4>
<p>I guess I think that this sort of case (where you have overlapping spans) is pretty confusing in the current mode</p>



<a name="135930771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930771">(Oct 16 2018 at 21:24)</a>:</h4>
<p>so even if something like footnotes is not <em>perfect</em>, it's potentially a step up</p>



<a name="135930775"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930775" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930775">(Oct 16 2018 at 21:24)</a>:</h4>
<p>not to say I would always want to do it</p>



<a name="135930784"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930784" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930784">(Oct 16 2018 at 21:24)</a>:</h4>
<p>I guess the best thing we could do is actually implement the change and inspect the <code>ui</code> diffs :)</p>



<a name="135930792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930792">(Oct 16 2018 at 21:24)</a>:</h4>
<p>confirm</p>



<a name="135930797"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930797" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930797">(Oct 16 2018 at 21:24)</a>:</h4>
<p>(should I open an issue or internals thread or something?)</p>



<a name="135930802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930802">(Oct 16 2018 at 21:25)</a>:</h4>
<p>just to keep from losing the idea...</p>



<a name="135930824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930824">(Oct 16 2018 at 21:25)</a>:</h4>
<p>Yes, although I think this is an idea that's been floating for a while, it'd be nice to have an actual place with it</p>



<a name="135930881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930881">(Oct 16 2018 at 21:26)</a>:</h4>
<p>Adding to <a href="https://github.com/rust-lang/rust/issues/51528" target="_blank" title="https://github.com/rust-lang/rust/issues/51528">https://github.com/rust-lang/rust/issues/51528</a> would also be nice</p>



<a name="135930888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930888">(Oct 16 2018 at 21:26)</a>:</h4>
<p>Although I feel some of the things listed there are higher priority</p>



<a name="135930976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135930976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135930976">(Oct 16 2018 at 21:28)</a>:</h4>
<p>Like being able to specify span labels in a subdiagnostic. That would make a nice difference.</p>



<a name="135931026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135931026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135931026">(Oct 16 2018 at 21:29)</a>:</h4>
<p>I would like to break out the formatting code into its own crate</p>



<a name="135931029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135931029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135931029">(Oct 16 2018 at 21:29)</a>:</h4>
<p>that is, something that lives on <a href="http://crates.io" target="_blank" title="http://crates.io">crates.io</a></p>



<a name="135931034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135931034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135931034">(Oct 16 2018 at 21:29)</a>:</h4>
<p>I wonder how plausible that is</p>



<a name="135931039"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135931039" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135931039">(Oct 16 2018 at 21:29)</a>:</h4>
<p>it'd take some careful work to "detach" it nicely from the compiler</p>



<a name="135931043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135931043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135931043">(Oct 16 2018 at 21:30)</a>:</h4>
<p>but I feel like we could iterate a lot faster this way</p>



<a name="135931099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135931099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135931099">(Oct 16 2018 at 21:30)</a>:</h4>
<p>/me all about detaching from the compiler these days</p>



<a name="135931104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135931104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135931104">(Oct 16 2018 at 21:30)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> possibly. I can take a look at it, maybe <span class="user-mention" data-user-id="129356">@Zack M. Davis</span> might be interested as well</p>



<a name="135931111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135931111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135931111">(Oct 16 2018 at 21:30)</a>:</h4>
<p>the idea would be to make it generic over the span type and the codemap type etc</p>



<a name="135931115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135931115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135931115">(Oct 16 2018 at 21:31)</a>:</h4>
<p>anyway</p>



<a name="135931183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135931183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135931183">(Oct 16 2018 at 21:32)</a>:</h4>
<p>But in order to move it out we'd need to stabilize the API surface, right? There are a couple of things I'd like to add before that, and remove (like <code>span_suggestion</code> without <code>Applicability</code>)</p>



<a name="135931187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135931187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135931187">(Oct 16 2018 at 21:32)</a>:</h4>
<p>Oh, I see that <span class="user-mention" data-user-id="116773">@csmoe</span> is <a href="https://github.com/rust-lang/rust/issues/51528#issuecomment-397840308" target="_blank" title="https://github.com/rust-lang/rust/issues/51528#issuecomment-397840308">way ahead of me</a></p>



<a name="135931193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135931193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135931193">(Oct 16 2018 at 21:32)</a>:</h4>
<blockquote>
<p>But in order to move it out we'd need to stabilize the API surface, right? There are a couple of things I'd like to add before that, and remove (like <code>span_suggestion</code> without <code>Applicability</code>)</p>
</blockquote>
<p>I mean it can be at a 0.x version for a while that changes its API surface frequently</p>



<a name="135931205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135931205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135931205">(Oct 16 2018 at 21:33)</a>:</h4>
<p>but yes, part of the benefit is trying to stabiize and convert on somethign nice</p>



<a name="135931397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/reformatting%20diagnostics/near/135931397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/reformatting.20diagnostics.html#135931397">(Oct 16 2018 at 21:36)</a>:</h4>
<p>I can see how we can enable the footnote output only if certain heuristics are triggered. I'm coming around to the idea...</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>